//
//  CYVideoDetail_CommentReplyTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/23.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYVideoDetail_CommentReplyTableViewCell.h"

@implementation CYVideoDetail_CommentReplyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setReplyModel:(CYCommentModel *)replyModel{
    _replyModel = replyModel;
    
    NSMutableAttributedString *muStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@:%@",replyModel.username,replyModel.content]];
    [muStr addAttribute:NSForegroundColorAttributeName value:RGBOF(0x4173AF) range:NSMakeRange(0, replyModel.username.length + 1)];
    
    self.replyLabel.attributedText = muStr;
    
    [self.replyLabel yb_addAttributeTapActionWithStrings:@[[NSString stringWithFormat:@"%@:",replyModel.username]] tapClicked:^(NSString *string, NSRange range, NSInteger index) {
        if (self.block) {
            self.block(replyModel.ID, replyModel.userId);
        }
    }];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
